// let localhost = 'http://qf-restapi.mdscjtest.com';
// let localhostBos = 'http://bos.api.mdscjtest.com';
// 根据不同地址给予不同配置
let domain = window.location.host.toLowerCase();
let domainConfig = {
  'm.mdscjtest.com': {
    localhost: 'http://qf-restapi.mdscjtest.com',
    jsonPath: '/static/json/dev/',
    WX: {
      appid: 'wx128899758d1e5819',
      _redirectServerUri: 'http://qf-restapi.mdscj.com/uc/dispatch',
      state: window.location.href + '|test'
    }
  },
  'm.mdscjgamma.com': {
    localhost: 'http://qf-restapi.mdscjgamma.com',
    jsonPath: '/static/json/dev/',
    WX: {
      appid: 'wx128899758d1e5819',
      _redirectServerUri: 'http://qf-restapi.mdscj.com/uc/dispatch',
      state: window.location.href + '|gamma'
    }
  },
  'm.mdscj.com': {
    localhost: 'http://qf-restapi.mdscj.com',
    jsonPath: '/static/json/prod/',
    WX: {
      appid: 'wx128899758d1e5819',
      _redirectServerUri: 'http://qf-restapi.mdscj.com/uc/dispatch',
      state: window.location.href + '|prod'
    }
  },
  'pre-m.mdscj.com': {
    localhost: 'http://pre-qf-restapi.mdscj.com',
    jsonPath: '/static/json/prod/',
    WX: {
      appid: 'wx128899758d1e5819',
      _redirectServerUri: 'http://qf-restapi.mdscj.com/uc/dispatch',
      state: window.location.href + '|preprod'
    }
  }
}[domain] || {
  localhost: 'http://qf-restapi.mdscjtest.com',
  jsonPath: '/static/json/dev/',
  WX: {
    appid: 'wx128899758d1e5819',
    _redirectServerUri: 'http://qf-restapi.mdscj.com/uc/dispatch',
    state: window.location.href + '|test'
  }
};

// init config domainConfig.localhost ||  domainConfig.localhostBos ||
// let localhost = domainConfig.localhost;
export var configInfo = domainConfig;
export var config = {
  /* 课程 */lesson: {
    list: 'static/json/lesson.json',
    myLessons: 'static/json/myLessons.json',
    detail: 'static/json/lessonDetail.json',
    /* 收藏 */addFav: 'static/json/op.json',
    /* 预约 */yuyue: 'static/json/op.json',
    /* 一次显示多少日期 */count: 14
  },
  /* 收藏 */myfav: {
    list: 'static/json/myLessons.json'
  },
  /* 用户 */user: {
    checkLogin: 'static/json/checkLogin.json',
    sendCode: 'static/json/op.json',
    saveInfo: 'static/json/op.json'
  },
  /* 评价 */evaluate: {
    list: 'static/json/evaluate.json',
    submit: 'static/json/op.json'
  },
  /* 通知 */notice: {
    list: 'static/json/notice.json'
  },
  /* 支付 */pay: {
    record: 'static/json/payrecord.json',
    submit: 'static/json/op.json'
  },
  /* 意见反馈 */feedback: {
    submit: 'static/json/op.json'
  },
  appkey: 'maidao',
  shareInfo: {
    logo: 'http://7xo7x8.com2.z0.glb.qiniucdn.com/logo_02.png',
    text: '买道商城：买到品质，买到乐趣，买到更好的生活'
  },
  wxAPIList: [
    'onMenuShareTimeline',
    'onMenuShareAppMessage',
    'onMenuShareQQ',
    'showOptionMenu',
    'showOptionMenu',
    'showMenuItems',
    'showAllNonBaseMenuItem',
    'hideMenuItems',
    'chooseWXPay',
    'chooseImage',
    'uploadImage'
  ]
};

export default config;
